/**
 * 
 */
package soa.security.ws;

import soa.security.exception.OrganizationException;

import javax.jws.WebParam;
import javax.jws.WebService;

/**
 * @author CreGu
 *
 */
@WebService
public interface RoleService {

	/**
	 * 角色信息新增
	 * 
	 * @param organizationId
	 * @param role
	 * @return
	 * @throws OrganizationException
	 */
	public boolean addRole(
			@WebParam(name = "organizationId") String organizationId,
			@WebParam(name = "role") String role) throws OrganizationException;

	/**
	 * 角色信息修改
	 * 
	 * @param organizationId
	 * @param role
	 * @return
	 * @throws OrganizationException
	 */
	public boolean updateRole(
			@WebParam(name = "organizationId") String organizationId,
			@WebParam(name = "role") String role) throws OrganizationException;

	/**
	 * 获取机构内的所有角色信息
	 * 
	 * @param organizationId
	 * @return
	 * @throws OrganizationException
	 */
	public String allRoles(
			@WebParam(name = "organizationId") String organizationId)
			throws OrganizationException;

	/**
	 * 获取指定角色信息
	 * 
	 * @param organizationId
	 * @param roleId
	 * @return
	 * @throws OrganizationException
	 */
	public String getRole(
			@WebParam(name = "organizationId") String organizationId,
			@WebParam(name = "roleId") String roleId)
			throws OrganizationException;
	
	/**
	 * 以下为关系服务
	 */

	public boolean addPersons(
			@WebParam(name = "organizationId") String organizationId,
			@WebParam(name = "roleId") String roleId,
			@WebParam(name = "personIds") String personIds)
			throws OrganizationException;

	public boolean removePersons(
			@WebParam(name = "organizationId") String organizationId,
			@WebParam(name = "roleId") String roleId,
			@WebParam(name = "personIds") String personIds)
			throws OrganizationException;

	public String allPersons(
			@WebParam(name = "organizationId") String organizationId,
			@WebParam(name = "roleId") String roleId)
			throws OrganizationException;

	public boolean addSubRoles(
			@WebParam(name = "organizationId") String organizationId,
			@WebParam(name = "roleId") String roleId,
			@WebParam(name = "subGroupIds") String subGroupIds)
			throws OrganizationException;

	public boolean removeSubRoles(
			@WebParam(name = "organizationId") String organizationId,
			@WebParam(name = "roleId") String roleId,
			@WebParam(name = "subGroupIds") String subGroupIds)
			throws OrganizationException;

	public String allSubRoles(
			@WebParam(name = "organizationId") String organizationId,
			@WebParam(name = "roleId") String roleId)
			throws OrganizationException;
}
